import initData from "./initData";

export default function reducer(state = initData, action) {
    switch (action.type) {
        case 'LOGINSTATE':
            return { ...state, loginState: action.stateValue };
        case 'USERINFO':
            return { ...state, userInfo: action.info };
        case 'SHOWSTATE':
            return { ...state, isShow: action.showState };
        case 'SHOWREGSTATE':
            return { ...state, isRegShow: action.showRegState };
        case 'SHOWLOADING':
            return { ...state, loginState: action.loginState };
        default:
            return { ...state }
    }
}